package com.xz.example.model.simple_model;

/**
 * @author 张志航     
 * @version V1.0.0
 * @projectName design_mode
 * @title     Logger   
 * @package    com.xz.example.model  
 * @date   2019/12/2 10:09  
 * @explain
 */
public class WeeklyReport implements Cloneable{

    private Attachment attachment; // 附件，一般可以有多个（用list来表示）
    private String name;
    private String date;
    private String content;

    public Attachment getAttachment() {
        return attachment;
    }

    public void setAttachment(Attachment attachment) {
        this.attachment = attachment;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    // 使用clone方法实现浅克隆
    @Override
    public WeeklyReport clone() throws CloneNotSupportedException {
        Object obj = null;
        try {
            obj =  super.clone();
            return (WeeklyReport) obj;
        } catch (CloneNotSupportedException e) {
            System.out.println("不支持复制！");
            return null;
        }
    }

    @Override
    public String toString() {
        return "WeeklyReport{" +
                "attachment=" + attachment +
                ", name='" + name + '\'' +
                ", date='" + date + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
